Skip to content

Conversation

@MarcoRossignoli
Copy link
Collaborator

Improve "real" instrumentation testing

image

cc: @tonerdo @petli

@MarcoRossignoli MarcoRossignoli added the enhancement General enhancement request label Aug 20, 2019

result.Document("Instrumentation.SelectionStatements.cs")
.AssertLinesCovered(BuildConfiguration.Release, (24, 1), (26, 0), (28, 0))
.AssertBranchesCovered(BuildConfiguration.Release, (24, 1, 1))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it make the test very dependent on the optimisations in the compiler, so they could start breaking on a different SDK version. Since these tests are about matching specific lines it seems better to just use Debug runs and not include any expected outcome for Release runs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it make the test very dependent on the optimisations in the compiler,

Yep it's true...talked also with Andrew #396 (comment) and we had same issue in past #389
Yes we could test only for debug config...but why if some bug happen on release and not on debug config for some reason related to "instrumentation" bug?If in future we put some conditional code related to some new roslyn behaviour?Maybe I'm too concern about something that won't never happen 😅 , but could be a good "doorbell", and maybe we could add the possibility to run test only for specific SDK like a custom xunit attribute [RunOnSdks("2.2.301","..")], to be very rigorous.
Another thing that I'm not sure is if also "debug" config will be stable...I mean also that config could depend on different SDK version, less likely but I'm not 100% sure.
BTW I don't have a super strong opinion and we could test only debug config...I tried to be complete as possible...
Thank's for review Peter!!!
@tonerdo thoughts?

@MarcoRossignoli
Copy link
Collaborator Author

MarcoRossignoli commented Sep 3, 2019

@tonerdo @petli what do you think about this PR?
I'd like at least another approval, open question is remove or not release asserts(btw if this lead to flaky CI we can remove also in future).

@MarcoRossignoli
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MarcoRossignoli
Copy link
Collaborator Author

MarcoRossignoli commented Sep 4, 2019

I'll merge this, low risk I need code for next PRs.

@MarcoRossignoli MarcoRossignoli merged commit a167c39 into coverlet-coverage:master Sep 4, 2019
@MarcoRossignoli MarcoRossignoli deleted the switch branch September 4, 2019 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement General enhancement request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants